package evq.codec.core.entities;

import java.util.Date;

public class Profiler {

	private long initialTime;
	private long finalTime;
	
	private int sumOperationQuantity;
	private int subtractOperationQuantity;
	private int multiplicationOperationQuantity;
	private int divisionOperationQuantity;
	private int comparisonOperationQuantity;

	public Profiler() {
		
	}
	
	public void startProfiling() {
		this.initialTime = new Date().getTime();
	}
	
	public void stopProfiling() {
		this.finalTime = new Date().getTime();
	}
	
	public long getExecutionTime() {
		return finalTime - initialTime;
	}

	public long getInitialTime() {
		return initialTime;
	}

	public long getFinalTime() {
		return finalTime;
	}

	public int getSumOperationQuantity() {
		return sumOperationQuantity;
	}

	public int getSubtractOperationQuantity() {
		return subtractOperationQuantity;
	}

	public int getMultiplicationOperationQuantity() {
		return multiplicationOperationQuantity;
	}

	public int getDivisionOperationQuantity() {
		return divisionOperationQuantity;
	}

	public int getComparisonOperationQuantity() {
		return comparisonOperationQuantity;
	}
	
	public void incrementSumOperations(int increment) {
		this.sumOperationQuantity += increment;
	}
	
	public void incrementSumOperations() {
		incrementSumOperations(1);
	}
	
	public void decrementSumOperations(int decrement) {
		this.sumOperationQuantity -= decrement;
	}
	
	public void decrementSumOperations() {
		decrementSumOperations(1);
	}
	
	public void incrementSubtractOperations(int increment) {
		this.subtractOperationQuantity += increment;
	}

	public void incrementSubtractOperations() {
		incrementSubtractOperations(1);
	}
	
	public void incrementMultiplicationOperations(int increment) {
		this.multiplicationOperationQuantity += increment;
	}
	
	public void incrementMultiplicationOperations() {
		incrementMultiplicationOperations(1);
	}
	
	public void incrementDivisionOperations(int increment) {
		this.divisionOperationQuantity += increment;
	}
	
	public void incrementDivisionOperations() {
		incrementDivisionOperations(1);
	}
	
	public void incrementComparisonOperations(int increment) {
		this.comparisonOperationQuantity += increment;
	}

	public void incrementComparisonOperations() {
		incrementComparisonOperations(1);
	}
}
